/*
 *    Copyright (c) 2018-2025, nart All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: nart
 */

package com.nai365.nart.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nai365.nart.common.core.to.mq.SeckillOrderTo;
import com.nai365.nart.common.core.util.R;
import com.nai365.nart.order.entity.Order;
import com.nai365.nart.order.entity.PaymentInfo;
import com.nai365.nart.order.vo.OrderConfirmVO;
import com.nai365.nart.order.vo.OrderSubmitVO;
import com.nai365.nart.order.vo.PayVO;
import com.nai365.nart.order.vo.SubmitOrderResponseVO;
import org.springframework.transaction.annotation.Transactional;

/**
 * 订单
 *
 * @author baogs
 * @date 2022-07-01 14:19:39
 */
public interface OrderService extends IService<Order> {

	OrderConfirmVO OrderConfirmVO() throws Exception;

	//@GlobalTransactional
	@Transactional
	SubmitOrderResponseVO submitOrder(OrderSubmitVO orderSubmitVO) throws Exception;

	void closeOrder(Order order);

	Order getOrderByOrderSn(String orderSn);

	PayVO getOrderPay(String orderSn);

	void handlePayResult(Integer targetOrderStatus, Integer payCode, PaymentInfo paymentInfo);

	IPage queryPageWithItem(Page page, Order order,Integer type);

	void updateOrderStatus(String orderSn, Integer code, Integer payType);

	void createSeckillOrder(SeckillOrderTo order);

	void completeOrder(Order order);

    R getAllMoney(Integer rank);

	void updateOrderStatusByOserId(String requestId, int i);

    Order findOrderByOrderId(String orderSn);

	boolean checkNoPay(Long userId);
}
